#!/bin/sh

TEMP_FILE=$(mktemp -p ${PWD} plotter.XXXXXXXXXX) && {
    
    ./test-fft-inversa -v ${@} > ${TEMP_FILE}
    
    gnuplot <<_EOF
set terminal jpeg
set output "${TEMP_FILE}.jpeg"
set title "Andamento FFT inversa"
set zero 1e-11
set yrange [-0.25:1.25]
plot [-0.25:255.25] "${TEMP_FILE}" using 1:2 title "FFT inversa" lt rgb "blue" with l, "${TEMP_FILE}" using 1:3 title "Segnale" lt rgb "orange" with l
_EOF

    rm -f "${TEMP_FILE}"
}
